package com.studyhub.api.problem.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.studyhub.api.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;

/**
 * 回答实体类
 * 
 * @author StudyHub Team
 */
@Getter
@Setter
@TableName("pr_answer")
@Schema(name = "Answer", description = "回答信息")
public class Answer extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "回答ID")
    private Long id;

    @Schema(description = "问题ID")
    private Long problemId;

    @Schema(description = "回答用户ID")
    private Long userId;

    @NotBlank(message = "回答内容不能为空")
    @Schema(description = "回答内容")
    private String content;

    @Schema(description = "点赞数量")
    private Integer likeCount = 0;

    @Schema(description = "踩数量")
    private Integer dislikeCount = 0;

    @Schema(description = "是否最佳答案：0-否，1-是")
    private Integer isBest = 0;

    @Schema(description = "状态：0-删除，1-正常，2-待审核")
    private Integer status = 1;

    @TableLogic
    @Schema(description = "逻辑删除：0-未删除，1-已删除")
    private Integer deleted = 0;
}
